# @Time : 2024-10-23 18:02
# @Author : Fioman 
# @Phone : 13149920693

lst = list(range(10))
tup = tuple(lst)
print(lst, tup)

tup = (1, 2, 3)
lst = list(tup)
print(lst, tup)

# 解包操作进行转换
lst = [1, 2, 3]
tup = *lst,  # 逗号是必须的,以为逗号是告诉编译器,这个*lst是一个元组
print(lst, tup)

tup = (1, 2, 3)
lst = [*tup]  # 解包的方式
lst2 = [tup]  # 这种也可以?,可以是可以,但是结果是 [(1,2,3)]
print(tup, lst, lst2)

# 生成器表达式来进行转换
tup = (1, 2, 3, 4)
lst = list(x for x in tup)
print(tup, lst)
